/**
 * @class tuan.view.sanpham.ProductDataView
 * @extends extendsClass
 * Description
 */
Ext.define('tuan.view.sanpham.ProductDataView', {
    extend: 'Ext.grid.Panel',
    xtype  : 'products_widget_list_view',
    collapsible:true,
    multiSelect: true,
    height : 200,
    viewConfig: {
            emptyText: 'No products to display'
    },
    columns : [
    	{xtype : "rownumberer"},
	    {
	      header : "Tên sản phẩm",
	      dataIndex : "product_name",
	      flex:2
	  	},
  		{
	      header : "Giá",
	      dataIndex : "price",
	      flex:2,
	      xtype: 'numbercolumn',
	      renderer : function(value){
	         return Ext.util.Format.currency(value, 'VND ')
	     	}
 		},
		{
		  header : "Trọng lượng (Kg)",
		  dataIndex : "weight",
		  flex:2,
		  renderer : function(value){
		     return value + ' kg'
		 }
		},
		{
	  		header : "Category",
		  	dataIndex : "cate_id",
		  	flex:3,
		  	renderer: function (value, metaData, record, row, col, store, gridView) {
			    // var name = 'Loading..';
			    var c = JSON.parse(localStorage.getItem('localStoreCates'));

			    for (var index in c) {
			        if(value === c[index].id){
			            name = c[index].catename
			        }
			    };
		    	return name;
			}
		}
	]	
});